package io.bdmc.modules.bss.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.bdmc.common.utils.MyMap;
import io.bdmc.common.utils.MyPage;
import io.bdmc.common.utils.R;
import io.bdmc.modules.bss.entity.SmkHeartbeat;
import io.bdmc.modules.bss.model.HeartbeatParam;
import io.bdmc.modules.bss.service.ISmkHeartbeatService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author huanglu
 * @since 2019-01-22
 */
@RestController
@RequestMapping("/bss/heart")
public class SmkHeartbeatController {

    @Autowired
    private ISmkHeartbeatService _heartSvs;
    
    @RequestMapping("/list")
    @RequiresPermissions("bss:heart:list")
    public R list(HeartbeatParam params) {
        MyPage<SmkHeartbeat> myPage = new MyPage<SmkHeartbeat>(params.getCurrent(), params.getSize());
        MyPage<SmkHeartbeat> map = _heartSvs.mySelectPage(myPage, params);
		return R.ok().putData(MyMap.ok(map.getRecords(), map.getTotal()));
    }
}

